package LeetCode;

/**
 * @author VX5
 * @Title: MJC
 * @ProjectName DataStructure
 * @Description: TODO
 * @date ${DAT}16:28
 */
public class E6 {//斐波那契数列 没有通过递归
    public static void main(String[] args) {
        System.out.println(fib(48));
    }
    public static int fib(int n) {
       int[] dp = new int[n+1];
       if (n <=1){
           return n;
       }else {
           dp[0] = 0;
           dp[1] = 1;
           for (int i = 2; i <= n; i++){
               dp[i]=(dp[i-1]+dp[i-2])% 1000000007;
           }
           return dp[n];
       }
    }
}
